Bipolar phototransistors can operate in either three-terminal configuration or two-terminal configuration. When operating in three-terminal configuration, the current gain of the phototransistor is high but the dark current is large since a large steady-state bias current may exist in the device, which increases steady-state power consumption and requires techniques for extracting photo-current out of the total current (dark current plus photo-current). On the other hand, when operating in two-terminal configuration, the base is floating. Therefore, the dark current is extremely low, but the current gain is not as high as that of three-terminal configuration. Therefore there is room for improvement in the art.